package com.iot08.api.controller;

import com.iot08.api.annotation.CheckAppSign;
import com.iot08.api.controller.base.BaseController;
import com.iot08.api.service.UserSmsNotifyService;
import com.iot08.api.vo.request.UserSmsNotifyBuyReqVo;
import com.iot08.api.vo.request.UserSmsNotifyQueryReqVo;
import com.iot08.common.utils.response.ResponseMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cwj
 * @description
 * @date 2025/3/16 15:12
 **/
@Slf4j
@RestController
@RequestMapping("getway/userSmsNotify")
public class UserSmsNotifyController extends BaseController {


    @Resource
    private UserSmsNotifyService userSmsNotifyService;

    /**
     * @description 查询用户所拥有的短信服务信息
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.utils.response.ResponseMap
     * @date @time 2025/3/16 16:48
     **/
    @PostMapping("/query")
    @CheckAppSign
    public ResponseMap queryUserSmsNotify(@Validated @RequestBody UserSmsNotifyQueryReqVo vo){
        return userSmsNotifyService.queryUserSmsNotify(vo.getBodyForm());
    }


    /**
     * @description 金币购买短信通知服务套餐
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.utils.response.ResponseMap
     * @date @time 2025/3/16 16:57
     **/
    @PostMapping("/buy")
    @CheckAppSign
    public ResponseMap buyUserSmsNotify(@Validated @RequestBody UserSmsNotifyBuyReqVo vo){
        return userSmsNotifyService.buyUserSmsNotify(vo.getBodyForm());
    } 


}
